package com.ktjy.crm.config;

import com.ktjy.crm.web.interceptor.AuthorizationInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        String [] pathPatterns = {"/*"};      //拦截路径
        String [] excludePathPatterns = {"/","/login","/dologin","/css/**","/fonts/**","images/**","/js/**","/localcss/**","/localjs/**"};
        registry.addInterceptor(new AuthorizationInterceptor()).addPathPatterns(pathPatterns).excludePathPatterns(excludePathPatterns);
    }
}
